Customer Churn

Author: David O'Donnell


Problem Statement and Summary

Business Case

Data

Recommendation Summary


Import Data and Packages


View Data


Cleanse Data

In lieu of customer id (which was not present in the dataset), "phone_number" is a unique value that can serve as the primary key.

Clean Up Data (Types and Errors)

Handling Missing Data and Null Values

Any maximum discounts that are errant/null have been imputed with 0 as there were no customers marked as "promo_purchaser".

Any apparel spend that are errant/null have been imputed with the median apparel spend per order multiplied by the number of orders.

The current data didn't allow imputation of improper state values. Rather than deriving conclusions from incorrect data, any value in the "state" column not pertaining to a state has been made null.

Adjust Column Datatypes

Converting variables to their proper format will enable more accurate downstream analysis.


Exploratory Data Analysis

Description:

Description:

Description:

Description:

Description:

Description:

Description:

Description:

Description:

Description:

Description:


Build and Evaluate Model

Define Variables

Dropping state and area codes from the population due to irrelevance and potential for drawing improper conclusions.

Normalize/Standardize Data (Set-Up Pipeline Steps and Hyperparameter Space)

Build Initial Model (Classification or Regression)

Base Model Selection: XGBClassifier

Accuracy Score

AUC Score

Precision

Recall/Sensitivity

F1 Score

Across all of the metrics, the XGBClassifier outperforms the other models listed.


Hyperparameter Tuning

GridSearchCV

Use GridSearchCV to determine the optimal hyperparameters based on the RandomSearchCV results

The model has been optimized with the appropriate hyperparameters (learning rate, depth, estimators) to yield the highest AUC against validation data.


Examine Feature Importances

Analysis


Key Takeaways

Application of Machine Learning for the Marketing Team

Interpretability

Future Areas of Exploration